﻿using CleanArchitecture.Infrastructure.Entities.Business;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace CleanArchitecture.Infrastructure.DataMapping.Business
{
    public partial class AdvertiseMap : NowaEntityTypeConfiguration<Advertise>
    {
        #region Methods

        /// <summary>
        /// Configures the entity
        /// </summary>
        /// <param name="builder">The builder to be used to configure the entity</param>
        public override void Configure(EntityTypeBuilder<Advertise> builder)
        {
            builder.ToTable("bus_advertise");
            builder.HasKey(column => column.Id);
            builder.Property(column => column.AdvBannerName).HasMaxLength(200);
            builder.Property(column => column.AdvBannerDescription).HasMaxLength(300);
            builder.Property(column => column.ItemsJson).HasMaxLength(2000);

            base.Configure(builder);
        }

        #endregion
    }
}
